#include <stdio.h>


int main()
{
	int n,m;
	int x;
	int i;
	int sum;
	int count=0;
	scanf("%d",&n);
	while(1)
	{
		if(count==n)
			break;
		sum=0;
		scanf("%d",&m);
		for(i=0;i<m;i++)
		{
			scanf("%d",&x);
			sum+=x;
		}
		printf("%d\n\n",sum);
		count++;
	}
	return 0;
}